package com.booter.consumer.config;

import com.booter.consumer.controller.AsycServletController;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ServletConfig {

    @Bean  //一定要加，不然这个方法不会运行
    public ServletRegistrationBean getServletRegistrationBean() {
        //一定要返回ServletRegistrationBean
        ServletRegistrationBean bean = new ServletRegistrationBean(new AsycServletController());
        //放入自己的Servlet对象实例
        bean.addUrlMappings("/user/push");  //访问路径值
        return bean;
    }
}
